package com.example.yls.demoa;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import java.util.ArrayList;

/**
 * Created by yls on 2018/10/22.
 */

public class StuAdapter extends RecyclerView.Adapter<StuViewHolder> {
    private Context context;
    private ArrayList<Student> studentArrayList;

    public StuAdapter(Context context, ArrayList<Student> studentArrayList) {
        this.context = context;
        this.studentArrayList = studentArrayList;
    }

    @Override
    public StuViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View view = LayoutInflater.from(context)
                .inflate(R.layout.list_item,parent,false);
        StuViewHolder stuViewHolder = new StuViewHolder(view);

        return stuViewHolder;
    }

    @Override
    public void onBindViewHolder(StuViewHolder holder, int position) {

    }

    @Override
    public int getItemCount() {
        return studentArrayList.size();
    }
}
